﻿using ERP.Abp.AntDesignUI.Exssions;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components;
using Volo.Abp.UI.Navigation;

namespace ERP.Abp.AntDesignUI
{
    public partial class AntPageBase: AbpComponentBase
    {
        protected override Task OnInitializedAsync()
        {
            SetCurrentMenu();
            return base.OnInitializedAsync();
        }
        protected override void OnInitialized()
        {
            SetCurrentMenu();
            base.OnInitialized();
        }
        protected void SetCurrentMenu()
        {
            var n = NavigationManager.Uri.QueryString(Const.NavigationQueryKey);
            if (n != null)
                CurrentMenu = IMyMenuManager.GetMenuItem(n).Result;
            else
              
                CurrentMenu = new ApplicationMenuItem("ERP.Work.Home", displayName: L["Menu:Home"], url: "", icon: "home");
        }
    }
}
